//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Entity, EntityResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooEntityList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<EntityResponse>(`/uctoo/entity/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooEntity = async (id: string) => {
  return requestClient.get<Entity>(`/uctoo/entity/${id}`);
};

export const adductooEntity = async (data: Partial<Entity>) => {
  return requestClient.post<Entity>('/uctoo/entity/add', data);
};

export const edituctooEntity = async (data: Partial<Entity>) => {
  return requestClient.post<Entity>('/uctoo/entity/edit', data);
};

export const deleteuctooEntity = async (id: string) => {
  return requestClient.post<any>('/uctoo/entity/del', { id });
};
